package dingtalk

import "time"

type DingtalkNewsStruct struct {
	Id        int       `json:"id" gorm:"type:int(10) unsigned auto_increment; NOT NULL; primary_key"`
	ClassId   int       `json:"class_id" gorm:"type:int(10); NOT NULL; COMMENT:'分类ID'"`
	Title     string    `json:"title" gorm:"type:varchar(100); COMMENT:'标题'"`
	Introduce string    `json:"introduce" gorm:"type:text; COMMENT:'介绍'"`
	Content   string    `json:"content" gorm:"type:text; COMMENT:'内容'"`
	ImagePath string    `json:"image_path" gorm:"type:varchar(255);  COMMENT:'图片'"`
	Sort      int       `json:"sort" gorm:"type:int(11);  COMMENT:'排序'"`
	Clicks    int       `json:"clicks" gorm:"type:int(10);  COMMENT:'浏览量'"`
	IsTop     int       `json:"is_top" gorm:"type:tinyint(1);  COMMENT:'置顶'"`
	IsShow    int       `json:"is_show" gorm:"type:tinyint(1);  COMMENT:'显示/禁用'"`
	Keywords  string    `json:"keywords" gorm:"type:varchar(100);  COMMENT:'关键词'"`
	State     int       `json:"state" gorm:"type:tinyint(1); "`
	CreatedAt time.Time `json:"created_at" gorm:"type:datetime"`
	UpdatedAt time.Time `json:"updated_at" gorm:"type:datetime"`
}

func (c *DingtalkNewsStruct) TableName() string {
	return "dingtalk_news"
}
